﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CarCricketMatchApp
{
    /// <summary>
    /// The player which is extend from passenger
    /// </summary>
    public class Player:Passenger
    {
        #region private varables

        private States status;
        private int currentScore;
        private int lastScore;
        private int orderIndex = 0;
        private Team ownTeam;
        private PlayerStyles style;
        private int inningscount;
        private int outCount;

        #endregion


        #region properties

        /// <summary>
        /// get and set the player status
        /// contains five status "Active,InActive ,Batting , Waiting_to_bat ,Out "
        /// </summary>
        public States Status
        {
            get { return status; }
            set { status = value; }
        }

        /// <summary>
        /// get and set the current score of player
        /// </summary>
        public int CurrentScore
        {
            get { return currentScore; }
            set { currentScore = value; }
        }

        /// <summary>
        /// get and set the last score of player
        /// </summary>
        public int LastScore
        {
            get { return lastScore; }
            set { lastScore = value; }
        }

        /// <summary>
        /// get and set the play order
        /// </summary>
        public int OrderIndex
        {
            get { return orderIndex; }
            set { orderIndex = value; }
        }

        /// <summary>
        /// get and set the player of team
        /// </summary>
        public Team OwnTeam
        {
            get { return ownTeam; }
            set { ownTeam = value; }
        }

        public PlayerStyles Style
        {
            get { return style; }
        }

        public int Inningscount
        {
            get { return inningscount; }
            set { inningscount = value; }
        }

        public int OutCount
        {
            get { return outCount; }
            set { outCount = value; }
        }
        #endregion

        public Player(string name):base(name)
        {
            status = States.InActive;
            currentScore = 0;
            lastScore = 0;
            orderIndex = 0;
            this.inningscount = 0;
            this.outCount = 0;

        }

        public Player(Team team,PlayerStyles style,string name)
            : this(name)
        {
            this.ownTeam = team;
            this.style = style;
        }

    }
}
